﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Demo
{
    public partial class Jquery : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            DataSet ds = new DataSet();
            using (DataTable dt = new DataTable("article"))
            {
                DataColumn dtc = new DataColumn("文章ID", typeof(Int32));
                dt.Columns.Add(dtc);
                dtc = new DataColumn("标题", typeof(String));
                dt.Columns.Add(dtc);
                dtc = new DataColumn("作者", typeof(String));
                dt.Columns.Add(dtc);
                DataRow dtr = dt.NewRow();
                dtr["文章ID"] = 1;
                dtr["标题"] = "太高兴了";
                dtr["作者"] = "王二";
                dt.Rows.Add(dtr);
                dtr = dt.NewRow();
                dtr["文章ID"] = 2;
                dtr["标题"] = "中大奖了";
                dtr["作者"] = "幽幽";
                dt.Rows.Add(dtr);
                dtr = dt.NewRow();
                dtr["文章ID"] = 3;
                dtr["标题"] = "下雪了";
                dtr["作者"] = "希望";
                dt.Rows.Add(dtr);

                dtr = dt.NewRow();
                dtr["文章ID"] = 4;
                dtr["标题"] = "下雪了";
                dtr["作者"] = "希望";
                dt.Rows.Add(dtr);
                ds.Tables.Add(dt);
            }
            GridView1.DataSource = ds.Tables["article"].DefaultView;
            GridView1.DataBind();

        }
    }
}